<!DOCTYPE html>
{% load i18n static %}
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>超级管理员登录</title>
    <style>
/* 超级管理员专属登录样式 - 红色主题 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff9ff3 100%);
    overflow: hidden;
    position: relative;
}

/* 动态背景效果 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: backgroundShift 10s ease-in-out infinite;
    z-index: 1;
}

@keyframes backgroundShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, -20px) rotate(5deg); }
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 25px;
    box-shadow:
        0 30px 60px rgba(255, 107, 107, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    padding: 50px;
    width: 100%;
    max-width: 480px;
    backdrop-filter: blur(20px);
    position: relative;
    transform: perspective(1000px) rotateX(2deg);
    animation: slideInUp 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 60px, 0) perspective(1000px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) perspective(1000px) rotateX(2deg);
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24, #ff9ff3, #ff6b6b);
    border-radius: 25px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: 50%;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.login-logo::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24, #ff9ff3);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-title {
    color: #2c3e50;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

.privilege-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.security-notice {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 30px;
    text-align: center;
    font-size: 13px;
    color: #856404;
    font-weight: 500;
}

.security-notice::before {
    content: '🔒';
    margin-right: 8px;
}

.login-form {
    margin-top: 40px;
}

.form-row {
    margin-bottom: 25px;
    position: relative;
}

.form-row label {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 15px;
}

.form-row input[type="text"],
.form-row input[type="password"] {
    width: 100%;
    padding: 16px 20px;
    border: 3px solid #ecf0f1;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #f8f9fa;
    position: relative;
}

.form-row input[type="text"]:focus,
.form-row input[type="password"]:focus {
    outline: none;
    border-color: #ff6b6b;
    background: white;
    box-shadow:
        0 0 0 4px rgba(255, 107, 107, 0.2),
        0 8px 25px rgba(255, 107, 107, 0.15);
    transform: translateY(-2px);
}

.submit-row {
    margin-top: 40px;
}

.submit-row input[type="submit"] {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.submit-row input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4);
}

.submit-row input[type="submit"]:active {
    transform: translateY(-1px);
}

.submit-row input[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-row input[type="submit"]:hover::before {
    left: 100%;
}

.error, .errornote {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border: 2px solid #ef5350;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.error::before, .errornote::before {
    content: '⚠️';
    margin-right: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #ecf0f1;
}

.login-footer a {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-footer a:hover {
    color: #ee5a24;
    text-decoration: underline;
}

/* 移动端响应式 */
@media (max-width: 480px) {
    .login-container {
        padding: 40px 25px;
        margin: 15px;
        transform: none;
    }

    .login-title {
        font-size: 28px;
    }

    .login-logo {
        width: 80px;
        height: 80px;
        font-size: 35px;
    }
}
    </style>
</head>
<body>
    <div class="page-wrapper">
        <div class="login-container">
            <div class="login-header">
                <div class="login-logo">
                    👑
                </div>
                <h1 class="login-title">超级管理员</h1>
                <p class="login-subtitle">最高权限管理后台</p>
                <div class="privilege-badge">🚀 SUPER ADMIN</div>
            </div>

            <div class="security-notice">
                此为超级管理员专属入口，请确保您拥有相应权限
            </div>

            {% if form.errors and not form.non_field_errors %}
                <div class="error">
                    <strong>登录失败，请检查以下信息：</strong>
                    {% for field in form %}
                        {% if field.errors %}
                            {{ field.errors|striptags }}
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}

            {% if form.non_field_errors %}
                <div class="errornote">
                    {{ form.non_field_errors|striptags }}
                </div>
            {% endif %}

            <form method="post" action="{{ app_path }}" class="login-form">
                {% csrf_token %}

                <div class="form-row">
                    <label for="{{ form.username.id_for_label }}">🔑 {{ form.username.label }}:</label>
                    {{ form.username }}
                </div>

                <div class="form-row">
                    <label for="{{ form.password.id_for_label }}">🔐 {{ form.password.label }}:</label>
                    {{ form.password }}
                </div>

                <div class="submit-row">
                    <input type="submit" value="🚀 进入超级管理后台" />
                    <input type="hidden" name="next" value="{{ next }}" />
                </div>
            </form>

            {% url 'admin_password_reset' as password_reset_url %}
            {% if password_reset_url %}
            <div class="login-footer">
                <a href="{{ password_reset_url }}">🔄 忘记密码？</a>
            </div>
            {% endif %}

            <div class="login-footer">
                <small>© 2024 Django Admin 学习项目 | 超级管理员版本</small>
            </div>
        </div>
    </div>
</body>
</html>
